/* 
* @Author: LDF QQ 47121862
* @Date:   2014-06-09 15:04:25
* @Last Modified by:   LDF QQ 47121862
* @Last Modified time: 2014-06-09 15:45:44
*/
$(function(){

	$('.ajaxInput').dblclick(function(){
		var _t=$(this),name = _t.attr('name'),val=_t.text(),url=_t.attr('url'),tid=_t.attr('tid'),
		h='<input type="text" class="p5" name="'+name+'" value="'+val+'">';
		_t.html(h)
		var tname=$('input[name='+name+']');
		tname.focus();
		tname.on('blur',function(){
			var v = $(this).val();
			$.post(url,{tname:v,tid:tid},function(re){
				if(re==1){
					$.msg({str:'<span class="green"><i class="icon-check icon-large mr5"></i>修改成功!</span>'});
					$(this).remove();
					_t.html(v);
				}else{
					$(this).remove();
					_t.html(val);
				}
			})
			
		})
	})
})